<?xml version="1.0" encoding="utf-8"?>
<tasks>
  <task id="WITs" name="WorkItemType definitions" plugin="Microsoft.ProjectCreationWizard.WorkItemTracking" completionMessage="WorkItemTypes created">
    <taskXml>
      <WORKITEMTYPES>
        <% @workitem_types.each do |wi| %>
        <WORKITEMTYPE fileName="WorkItem Tracking\\TypeDefinitions\\<%= wi %>" />
        <% end %>
      </WORKITEMTYPES>
    </taskXml>
  </task>
  <task id="WIs" 
		name="WorkItems" 
		plugin="Microsoft.ProjectCreationWizard.WorkItemTracking" 
		completionMessage="Work items uploaded">
    <dependencies>
      <dependency taskId="WITs" />
    </dependencies>
    <taskXml>
			<WORKITEMS>
				<!-- entscheidungspunkte -->
				<% @milestones.each do |mstone| %>
				<%= mstone.snippet %>
				<% end %>
				<!-- activitaeten -->
				<% @activities.each do |act| %>
				<%= act.snippet %>
				<% end %>
				<!-- initiale produkte -->
				<% @products.each do |act| %>
				<%= act.snippet %>
				<% end %>
			</WORKITEMS>
		</taskXml>
  </task>
  <task id="Queries" name="Stored Query Definitions" plugin="Microsoft.ProjectCreationWizard.WorkItemTracking" completionMessage="Queries uploaded">
    <dependencies>
      <dependency taskId="WIs" />
      <dependency taskId="WITs" />
    </dependencies>
    <taskXml>
      <QUERIES>
       <% @queries.each do |wi| %>
        <Query name="<%= wi.gsub(".wiq","").gsub(/[A-Z]/){ |l| " #{l}"}.strip %>" fileName="WorkItem Tracking\\Queries\\<%= wi %>"/>
        <% end %>
      </QUERIES>
    </taskXml>
  </task>
</tasks>